'use strict';
import { PROCESS } from '../base/process';
import { log } from '../base/log';
/**
 * 
 * CSS3 HTML5 新生API兼容与探测 
 * 
 * 当检测到浏览器不支持某项属性时，应该及时给出提醒，及时反馈到开发人员，做出相关的兼容处理
 * 
 * @desc 当函数调用次数大于1的时候，不在输出浏览器自身信息了
 * 
 **/
export const transform = PROCESS.VENDOR_LOGO + 'Transform';
export const transition = PROCESS.VENDOR_LOGO + 'Transition';
export const perspective = PROCESS.VENDOR_LOGO + 'Perspective';
export const animation = PROCESS.VENDOR_LOGO + 'Animation';

/**
 * CSS3 Transform Transition Perspective Animation 检测 
 */
void function () {
  const style = (document.body || document.documentElement).style;

  if (!transition in style) {
    // 过渡
    log.warn('Transition is not supported, Please provide a compatibility solution');
  }

  if (!transform in style) {
    // 变形
    log.warn('transform is not supported, Please provide a compatibility solution');
  }

  if (!perspective in style) {
    // 3D透视
    log.warn('perspective is not supported, Please provide a compatibility solution');
  }

  if (!animation in style) {
    // 动画
    log.warn('animation is not supported, Please provide a compatibility solution');
  }

  if (!'ontouchstart' in window) {
    // touch 事件
    log.warn('`touch` is not supported, Please provide a compatibility solution');
  }
}();